package p2000;

import java.util.Scanner;

public class Main2025查找最大元素 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            String str = scanner.nextLine();
            StringBuilder sb = new StringBuilder("");
            char[] arr = str.toCharArray();
            char max = 65;
            for (char c : arr) {
                if (max < c) {
                    max = c;
                }
            }

            for (char c : arr) {
                if (max == c) {
                    sb.append(c).append("(max)");
                } else {
                    sb.append(c);
                }
            }

            System.out.println(sb);
        }
    }

}
